package com.api.customization.unionpay.market.web;


import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.customization.unionpay.market.entity.Response;
import com.customization.unionpay.market.service.MarketingDailyService;
import com.customization.unionpay.market.service.impl.MarkertingDailyServiceImpl;
import com.customization.unionpay.market.util.RequestUtil;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;

/**
 * 营销日报表台账的接口类
 */
@Path("/market/daily")
public class MarketDailyController{

    @Path("/update/zt")
    @POST
    @Produces({MediaType.APPLICATION_JSON})
    public String updateZt(@Context HttpServletRequest request,
                                @Context HttpServletResponse response){

        MarketingDailyService service = new MarkertingDailyServiceImpl();
        JSONObject object = RequestUtil.dealPostRequest(request);
        service.updateMarketingDailyZt(object.getString("zt"),object.getString("sqm"));
         return JSON.toJSONString(Response.success("修改成功"));
    }
}
